import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

export const routes = [
  {
    path: '/404',
    name: 'Unknown',
    component: () => import('@/views/unknown/index.vue')
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/index.vue')
  },
  {
    path: '/',
    name: 'Home',
    redirect: 'dashboard',
    component: () => import('@/layout/Home.vue'),
    children: [
      {
        path: 'dashboard',
        name: 'Dashboard',
        component: () => import('@/views/dashboard/index.vue'),
        meta: { title: '首页', icon: '' }
      },
      {
        path: '/goods',
        name: 'Goods',
        component: () => import('@/views/goods/index.vue'),
        meta: { title: '商品管理', icon: '' }
      },
      {
        path: 'order',
        name: 'Order',
        component: () => import('@/views/order/index.vue'),
        meta: { title: '订单管理', icon: '' }
      },
      {
        path: 'sort',
        name: 'Sort',
        component: () => import('@/views/sort/index.vue'),
        meta: { title: '分类管理', icon: '' }
      },
      {
        path: 'shop',
        name: 'Shop',
        component: () => import('@/views/shop/index.vue'),
        meta: { title: '店铺管理', icon: '' }
      },
      {
        path: 'input',
        name: 'Input',
        component: () => import('@/views/input/index.vue'),
        meta: { title: '表单管理', icon: '' }
      },
      {
        path: 'active',
        name: 'Active',
        component: () => import('@/views/active/index.vue'),
        meta: { title: '数字翻页', icon: '' }
      },
      {
        path: 'moves',
        name: 'Moves',
        component: () => import('@/views/moves/index.vue'),
        meta: { title: '鼠标拖拽', icon: '' }
      },
      {
        path: 'regester',
        name: 'Regester',
        component: () => import('@/views/regester/index.vue'),
        meta: { title: '菜单设计', icon: '' }
      },
      {
        path: 'echart',
        name: 'Echart',
        component: () => import('@/views/echart/index.vue'),
        meta: { title: '图表数据', icon: 'el-icon-position' }
      }
    ]
  }

]

const router = new VueRouter({
  // mode: 'history',
  routes
})

export default router
